const _ = require('lodash');
import Vue from 'vue';
import VueRouter from 'vue-router';
import Home from '../components/home.vue';
Vue.use(VueRouter);

const routers = [
    {
        name: 'home',
        path: '/',
        component: Home,
        meta: {title: '记分牌'},
    },
];
let router = new VueRouter({
    routes: routers
});
router.beforeEach((to, from, next) => {
    next();
});
router.afterEach(route => {
    /** set title */
    if (route.meta && route.meta.title) {
        document.title = route.meta.title;
    }
});
export default router;
